{include file='../application/index/view/default/header.html' title='团团呗的个人信息管理网站' userData=$userData }

<style>
	#pagination li{
		padding: 0;
	}
	#pagination li a{
		display: inline-block;
		padding: 0.3em 1.3em;
		border: solid 1px rgba(160, 160, 160, 0.3);
		background: #fff;
		margin-right: 10px;
		font-size: 18px; 
	}
	#pagination .active a{
		color: #2ebaae;
		border-color:#2ebaae !important; 
	}

</style>
		<!-- Main -->
		<div id="main">

			<!-- Post -->
			
					
			<div id="article">

			</div>


			<ul class="actions pagination" id="pagination"></ul>

		</div>


		<!-- Sidebar -->
		<section id="sidebar">

			<!-- Intro -->
			<section id="intro">
				<a href="#" class="logo">
					<img src="/static/images/logo.jpg" alt="" />
				</a>
				<header>
					<h2>个人信息管理网站</h2>
					<p>是一个记录自己生活中的点点滴滴，分享一些个人的琐碎往事。青春是一本仓促的书，我们流着泪一读再读。</p>
				</header>
			</section>

			<!-- Mini Posts -->
			<section>
				<div class="mini-posts">

					<!-- Mini Post -->
					<?php foreach($RecommendNewsList as $Recommend){?>
					<article class="mini-post">
						<header>
							<h3>
								<a href="#">{$Recommend.title}</a>
							</h3>
							<time class="published" datetime="2018-10-20"><?php echo date('Y-m-d',strtotime($Recommend['ntime']));?></time>
							<a href="#" class="author">
								<img src="/static/images/avatar.jpg" alt="" />
							</a>
						</header>
						<a href="#" class="image">
							<img src="/uploads/{$Recommend.imgurl}" alt="" />
						</a>
					</article>
					<?php }?>
					



				</div>
			</section>

			<!-- Posts List -->
			<!-- <section>
				<ul class="posts">
					<li>
						<article>
							<header>
								<h3>
									<a href="#">更新日志，个人通讯录新增邮箱添加功能</a>
								</h3>
								<time class="published" datetime="2018-10-20">5月  20, 2018</time>
							</header>
							<a href="#" class="image">
								<img src="/static/images/pic08.jpg" alt="" />
							</a>
						</article>
					</li><li><article>
							<header>
								<h3>
									<a href="#">更新日志，个人通讯录现在可以添加地区信息了</a>
								</h3>
								<time class="published" datetime="2018-10-15">5月  15, 2018</time>
							</header>
							<a href="#" class="image">
								<img src="/static/images/pic09.jpg" alt="" />
							</a>
						</article></li><li><article><header><h3><a href="#">更新日志，现在个人通讯录正式版以向外开放了</a></h3><time class="published" datetime="2018-10-10">5月  10, 2018</time></header>
							<a href="#" class="image">
								<img src="/static/images/pic10.jpg" alt="" />
							</a>
						</article>
					</li><li><article><header><h3>
									<a href="#">更新日志，个人通讯录测试版可以抢先体验了</a>
								</h3>
								<time class="published" datetime="2018-10-08">5月  8, 2018</time>
							</header>
							<a href="#" class="image">
								<img src="/static/images/pic11.jpg" alt="" />
							</a>
						</article>
					</li></ul>
			</section> -->

			<!-- About -->
			<section class="blurb">
				<h2>关于我</h2>
				<p>杨建的个人信息管理网站
					<br/>是一个记录自己生活中的点点滴滴，分享一些个人的琐碎往事。
					<br/>青春是一本仓促的书，我们流着泪一读再读。</p>
				<!-- <ul class="actions">
					<li>
						<a href="#" class="button">了解更多</a>
					</li>
				</ul> -->
			</section>

			<!-- Footer -->
			<!-- <section id="footer">
				<ul class="icons">
					<li>
						<a href="#" class="fa-twitter">
							<span class="label">Twitter</span>
						</a>
					</li>
					<li>
						<a href="#" class="fa-facebook">
							<span class="label">Facebook</span>
						</a></li><li>
						<a href="#" class="fa-instagram">
							<span class="label">Instagram</span>
						</a>
					</li>
					<li>
						<a href="#" class="fa-rss">
							<span class="label">RSS</span>
						</a>
					</li>
					<li>
						<a href="#" class="fa-envelope">
							<span class="label">Email</span>
						</a></li></ul>
				<p class="copyright">团团呗的个人信息管理网站</p>
			</section> -->

		</section>

	</div>


	<!-- Scripts -->
	
	<script>
	
	$(document).ready(function(){

		var page = 1;
		console.log(1111);
        function getPageNewsList (page) {
            $.ajax({
                type: "get",
                url: '/index/index/getPageNewsList?limit=2&page='+page,
				
                success: function(result, textStatus){
                    var ulBody = $('#article');
                    chtml = '';
                    var newsList = result.newsList;
                    if(newsList.length == 0){
                        chtml = '没有文章';
                    }else{
                        for(var i in newsList){
                            chtml += '<article class="newsList post"><header><div class="title"><h2><a href="/index/index/detail?nid='+newsList[i].nid+'">'+newsList[i].title+'</a></h2><p>勇敢的人不是不害怕，而是怕也要向前走。</p></div><div class="meta"><time class="published" datetime="2018-06-01">'+newsList[i].ntime+'</time><a href="#" class="author"><span class="name">'+newsList[i].username+'</span><img src="/static/images/avatar.jpg" alt="" /></a></div></header><a href="/index/index/detail?nid='+newsList[i].nid+'" class="image featured"><img src="/uploads/'+newsList[i].imgurl+'" alt="" /></a><div class="content"><p>'+newsList[i].remark+'</p></div><footer><ul class="actions"><li><a href="/index/index/detail?nid='+newsList[i].nid+'" id="reading" class="button big">继续阅读</a></li></ul></footer></article>'
                        }
                    }
                    ulBody.html(chtml);

                    var pageBody = $('#pagination');
                    var pageCount = Math.ceil(result.count/result.limit);
                    phtml = '';
                    for (var i=1;i<=pageCount;i++) {
                        if(i == page){
                            var style = 'class="active"';
                        }else{
                            var style = '';
                        }

                        phtml += "<li "+style+"><a href='javascript:;'  data-page='"+i+"'"+" class='page_btn' >"+i+"</a></li>"

                    }
                    pageBody.html(phtml);

                    $('.page_btn').on('click',function(){
                        var page = $(this).data('page');
                        getPageNewsList(page);
                    });
                }
            });
        }
        getPageNewsList(page);


	})
	
	</script>

</body>

</html>